﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administrator/Views/Shared/AdminMasterPage.master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<easyccms.BusinessLayer.Entities.Article>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page-title ui-widget-content ui-corner-all">
        <div class="float-right">
            <%= Html.ActionLink("Add new","Create") %>
        </div>
        <h1>
            <b>Article Management</b></h1>
        <div class="other">
            <div class="hastable">
                <table id="Table1">
                    <thead>
                        <tr>
                            <th>
                                #
                            </th>
                            <th>
                                Title of Article
                            </th>
                            <th>
                                Created
                            </th>
                            <th>
                                Menu Item
                            </th>
                            <th>
                                Menu
                            </th>
                            <td>
                                Author
                            </td>
                            <th>
                                ID
                            </th>
                            <th style="width: 100px">
                                Options
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            int i = 0;
                            foreach (var item in Model)
                            { %>
                        <tr>
                            <td>
                                <%: i++ %>
                            </td>
                            <td>
                                <%: item.Title %>
                            </td>
                            <td>
                                <%: String.Format("{0:g}", item.Created) %>
                            </td>
                            <td>
                                <%: (item.MenuItem!=null)?item.MenuItem.Name:"N/A"%>
                            </td>
                            <td>
                                <%: (item.MenuItem != null) ? item.MenuItem.Menu.Name : "N/A"%>
                            </td>
                            <td>
                                <%= string.Format("{0} {1}", item.User.UserProfile.Name, item.User.UserProfile.Surname)%>
                            </td>
                            <td>
                                <%: item.ArticleId %>
                            </td>
                            <td>
                                <%: Html.ActionLink("Edit", "Edit", new { id=item.ArticleId }) %>
                                |
                                <%: Html.ActionLink("Bin it", "MoveToBin", new { id = item.ArticleId })%>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </div>
            <div class="clearfix">
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JavaScriptHolder" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
</asp:Content>
